home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1998 #1 / Amiga Plus 1998 #1.iso / demo-versionen / haage&partner / warpup-warpos / source / tools / showtasks.p < prev    next >
Text File  |  1997-09-24  |  5KB  |  144 lines

  1.                 incdir  include:
  2.                 incdir  lvo:
  3.  
  4. **      '(C) Copyright 1997 Haage & Partner Computer GmbH'
  5. **           All Rights Reserved
  6.  
  7.                 include powerpc/ppcmacros.i
  8.                 include powerpc/powerpc.i
  9.                 include powerpc/tasksppc.i
  10.                 include exec/nodes.i
  11.  
  12.                 include powerpc_lib.i
  13.                 include exec_lib.i
  14.                 include dos_lib.i
  15.  
  16.                 STRUCTURE       TASKINFO,0
  17.                 APTR            TASKINFO_NAME
  18.                 APTR            TASKINFO_LOCATION
  19.                 ULONG           TASKINFO_TYPE
  20.                 ULONG           TASKINFO_STATE
  21.                 ULONG           TASKINFO_PRI
  22.                 ULONG           TASKINFO_MMUSETUP
  23.                 ULONG           TASKINFO_TABLE
  24.                 ULONG           TASKINFO_STACKSIZE
  25.                 ULONG           TASKINFO_SPLOWER
  26.                 ULONG           TASKINFO_SIGALLOC
  27.                 ULONG           TASKINFO_SIGWAIT
  28.                 ULONG           TASKINFO_SIGRECVD
  29.                 LABEL           TASKINFO_SIZE
  30.  
  31.  
  32.                 xref    _SysBase
  33.                 xref    _DOSBase
  34.                 xref    _PowerPCBase
  35.                 xref    _LinkerDB
  36.                 smalldata
  37.                 executable
  38.                 escapestr
  39.                 version 10
  40.  
  41. start
  42.                 prolog  1024
  43.                 pushgpr r28-r31
  44.                 la      r4,PPCInfo_Tags
  45.                 CALLPOWERPC     GetInfo
  46.                 lw      r28,Tag_PAGETABLE
  47.                 lnk     r29,-TASKINFO_SIZE
  48.                 subi    r29,r29,TASKINFO_SIZE
  49.                 CALLPOWERPC     LockTaskList
  50.                 mr      r31,r3
  51. .loop
  52.                 lwz     r30,LN_SUCC(r31)
  53.                 tstw    r30
  54.                 beq     .done
  55.                 lwz     r31,TASKPTR_TASK(r31)
  56.                 lwz     r0,LN_NAME(r31)
  57.                 stw     r0,TASKINFO_NAME(r29)
  58.                 stw     r31,TASKINFO_LOCATION(r29)
  59.                 la      r3,customtask
  60.                 lwz     r4,TASKPPC_FLAGS(r31)
  61.                 bittst  r4,TASKPPCP_SYSTEM
  62.                 beq     .nosystem
  63.                 la      r3,systemtask
  64. .nosystem
  65.                 stw     r3,TASKINFO_TYPE(r29)
  66.                 lbz     r4,TC_STATE(r31)
  67.                 la      r3,state_run
  68.                 cmplwi  r4,TS_RUN
  69.                 beq     .statedone
  70.                 la      r3,state_ready
  71.                 cmplwi  r4,TS_READY
  72.                 beq     .statedone
  73.                 la      r3,state_wait
  74. .statedone
  75.                 stw     r3,TASKINFO_STATE(r29)
  76.                 lba     r3,LN_PRI(r31)
  77.                 stw     r3,TASKINFO_PRI(r29)
  78.  
  79.                 lwz     r4,TASKPPC_FLAGS(r31)
  80.                 la      r3,pagedMMU
  81.                 bittst  r4,TASKPPCP_BAT
  82.                 beq     .nobat
  83.                 la      r3,batMMU
  84. .nobat
  85.                 stw     r3,TASKINFO_MMUSETUP(r29)
  86.                 lwz     r0,TASKPPC_TABLE(r31)
  87.                 tstw    r0
  88.                 bne     .cont
  89.                 mr      r0,r28
  90. .cont
  91.                 stw     r0,TASKINFO_TABLE(r29)
  92.                 lwz     r0,TASKPPC_STACKSIZE(r31)
  93.                 stw     r0,TASKINFO_STACKSIZE(r29)
  94.                 lwz     r0,TC_SPLOWER(r31)
  95.                 stw     r0,TASKINFO_SPLOWER(r29)
  96.                 lwz     r0,TC_SIGALLOC(r31)
  97.                 stw     r0,TASKINFO_SIGALLOC(r29)
  98.                 lwz     r0,TC_SIGWAIT(r31)
  99.                 stw     r0,TASKINFO_SIGWAIT(r29)
  100.                 lwz     r0,TC_SIGRECVD(r31)
  101.                 stw     r0,TASKINFO_SIGRECVD(r29)
  102.                 la      _d1,infotext
  103.                 mr      _d2,r29
  104.                 RUN68K_XL       _DOSBase,VPrintf
  105.                 mr      r31,r30
  106.                 b       .loop
  107. .done
  108.                 CALLPOWERPC     UnLockTaskList
  109. .close
  110.                 addi    r29,r29,TASKINFO_SIZE
  111.                 ulnk    r29,-TASKINFO_SIZE
  112.                 popgpr
  113.                 epilog
  114.  
  115.                 section data
  116.  
  117. PPCInfo_Tags
  118.                 dc.l    PPCINFO_PAGETABLE
  119. Tag_PAGETABLE   dc.l    0
  120.                 dc.l    0
  121.  
  122. infotext        dc.b    "Task name:                    %s\n"
  123.                 dc.b    "Task location:                %08lx\n"
  124.                 dc.b    "Task type:                    %s\n"
  125.                 dc.b    "Task state:                   %s\n"
  126.                 dc.b    "Task priority:                %ld\n"
  127.                 dc.b    "MMU setup:                    %s\n"
  128.                 dc.b    "Page table location:          %08lx\n"
  129.                 dc.b    "Stack size:                   %ld\n"
  130.                 dc.b    "Stack location (lower bound): %08lx\n"
  131.                 dc.b    "Signals allocated:            %08lx\n"
  132.                 dc.b    "Signals to wait:              %08lx\n"
  133.                 dc.b    "Signals received:             %08lx\n\n"
  134.                 dc.b    0
  135.  
  136. customtask      dc.b    "CUSTOM",0
  137. systemtask      dc.b    "SYSTEM",0
  138. state_run       dc.b    "RUNNING",0
  139. state_ready     dc.b    "READY",0
  140. state_wait      dc.b    "WAITING",0
  141. pagedMMU        dc.b    "PAGED MMU SETUP",0
  142. batMMU          dc.b    "BAT SETUP",0
  143.  
  144.